﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Product_ProductAttributeList.ascx.cs"
    Inherits="HUGATE.Item.Controls.Product_ProductAttribute.Product_ProductAttributeList" %>
<%@ Register Src="Product_ProductAttributeEdit.ascx" TagName="Product_ProductAttributeEdit"
    TagPrefix="uc1" %>
<%@ Register Src="~/Controls/ERP/Common/SearchObject.ascx" TagName="SearchObject"
    TagPrefix="uc3" %>
 <script type="text/javascript">
        function CheckHTML(element) {
            var text = document.getElementById(element).value;
            if (text.indexOf('<') > -1 || text.indexOf('>') > -1) {
                alert("Chuỗi nhập có thẻ HTML");
                document.getElementById(element).value = "";
            }

        }
</script>
<asp:UpdatePanel ID="udpProduct_ProductAttribute" runat="server" UpdateMode="Conditional">
    <contenttemplate>
            <asp:GridView ID="grvObject" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="Gridview" DataKeyNames="AttributeID" 
            PageSize="20" width=100% >
            <EmptyDataTemplate>
                <center>
                    <%#HUGATE.Utility.ResxManager.GetString("BUTEmptyData")%>
                </center>
            </EmptyDataTemplate>
            <Columns>
                      
                <asp:TemplateField >
                    <ItemStyle CssClass="Update" />
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtEdit" runat="server" CommandName="Select"  CommandArgument='<%#Eval("AttributeID")%>'
                            Text='<%#Eval("AttributeName")%>' onclick="lbtEdit_Click">
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>           
                 <asp:BoundField DataField="ValueName">
                    <ItemStyle />
                </asp:BoundField>                                        
          
                    <asp:BoundField DataField="ValueDescription">
                    <ItemStyle />
                </asp:BoundField>

                <asp:TemplateField>
                    <ItemStyle CssClass="Delete" />
                    <ItemTemplate>                                       
                        <asp:LinkButton ID="lbtDelete" runat="server" CommandArgument='<%#Eval("AttributeID")%>'
                            CssClass="DeleteBtn" OnClick="imgDelete_Click" OnClientClick='<%# "return confirm(\"" + string.Format(HUGATE.Utility.ResxManager.GetString("DeleteConfirm"), "") + "\");" %>'
                            ToolTip='<%#HUGATE.Utility.ResxManager.GetString("Delete")%>'>
                        </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="Row" />
            <PagerStyle CssClass="Pager" />
            <HeaderStyle CssClass="Header" />
            <AlternatingRowStyle CssClass="RowAlt" />
        </asp:GridView>


 </contenttemplate>
</asp:UpdatePanel>
<div class="Height">
</div>
<div align="left">
    <asp:Button ID="btnAdd" runat="server" CssClass="Control_Button2" Text="Thêm mới"
        OnClick="btnAdd_Click1" />
</div>
<div class="Height">
</div>
<asp:UpdatePanel ID="udpProductProductAttributeEdit" runat="server" UpdateMode="Conditional">
    <contenttemplate>
                <asp:Panel ID="pnlUpdateProductProductAttribute" runat="server" CssClass="Popup_Table" Style="display: none;
                    width: 700px">
                    <div class="Popup_Title">
                        <table border="0" cellpadding="0" cellspacing="0" class="Popup_Title" style="width: 100%">
                            <tr>
                                <td class="Popup_Title">
                                    <strong> Thêm Sản Phẩm </strong>
                                </td>
                                <td align="center" class="Popup_Title" style="padding-right: 2px; width: 20px">
                                    <div class="Popup_BtClose" style="width: 17px; height: 17px; text-align: center">
                                        <asp:LinkButton ID="lbtCloseProductProductAttribute" runat="server" CssClass="Popup_BtClose" Style="width: 17px;
                                            height: 17px;">&nbsp;&nbsp;&nbsp;
                                        </asp:LinkButton>
                                    </div>
                                 
                                </td>
                            </tr>
                        </table>
                    </div>
                   
                    <div class="Popup_Content" >
                      <uc1:Product_ProductAttributeEdit ID="ctrlProduct_ProductAttributeEdit" runat="server" />
                     </div> 
                      <div id="divTemp" runat="server">
                    </div>           
                <ajax:ModalPopupExtender ID="mpeUpdateProductProductAttribute" runat="server" BackgroundCssClass="ModalPopupBackground"
                    CancelControlID="lbtCloseProductProductAttribute" PopupControlID="pnlUpdateProductProductAttribute" TargetControlID="divTemp">
                </ajax:ModalPopupExtender>
            </asp:Panel> 
            </contenttemplate>
</asp:UpdatePanel>
